package com.wangsh.splider.web.head.intercepor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import com.wangsh.splider.common.util.ConstatFinalUtil;
import com.wangsh.splider.controller.BaseController;

/**
 * 配置拦截器
 * @author Xh-Win10-Server
 */
@Component("authHeadInterceptor")
public class AuthHeadInterceptor extends BaseController implements HandlerInterceptor
{
	/* 管理员的登录网址 */
	private String loginUrl = ConstatFinalUtil.CONFIG_JSON.getString("usersCenter.head.login.url") ; 
	/* 验证token的网址 */
	private String verifyTokenURL = ConstatFinalUtil.CONFIG_JSON.getString("usersCenter.outer.url") ; 
	/* 请求的私钥 */
	private String priKey = ConstatFinalUtil.CONFIG_JSON.getString("private.key");
	
	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
	{
		ConstatFinalUtil.SYS_LOGGER.info("--preHandle--");
		
		/* 设置一些公共的变量 */
		this.commonOper(request);
		return true;
	}
}
